package person;

import java.util.Calendar;

public class Customer extends User{

	/**
	 * se la persona non esiste nel sistema
	 * @param name
	 * @param surname
	 * @param taxCode
	 * @param residence
	 * @param phoneNumber
	 * @param fax
	 * @param email
	 * @param type
	 * @param VAT
	 */
	public Customer(String name, String surname, String taxCode, String residence, String phoneNumber, String fax, String email, Type type, String VAT,Calendar BirthDate) {
		super(name, surname, taxCode, residence, phoneNumber, fax, email,BirthDate);
		this.type = type;
		this.VAT = VAT;
	}
	
	/**
	 * se la persona esiste gi�
	 * @param person
	 * @param type
	 * @param VAT
	 */
	public Customer(Person person, Type type, String VAT) {
		super(person);
		this.type = type;
		this.VAT = VAT;
	}
	
	public Customer(long id, Person person, Type type, String VAT) {
		super(id, person);
		this.type = type;
		this.VAT = VAT;
	}
	public Type getType() {
		return type;
	}
	public void setType(Type type) {
		this.type = type;
	}
	public String getVAT() {
		return VAT;
	}
	public void setVAT(String VAT) {
		this.VAT = VAT;
	}
	public boolean contains(String filter) {
		String string = type +" "+ VAT;
		if(string.contains(filter) || super.contains(filter))
			return true;
		return false;
	}
	public enum Type{
	PERSON,
	COMPANY}
	private Type type;
	private String VAT;
}
